package cn.itsource.service.impl;


import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.file.FileNameUtil;
import cn.hutool.core.util.IdUtil;
import cn.itsource.service.IOssService;
import cn.itsource.template.OssTemplate;
import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.PutObjectRequest;
import com.aliyun.oss.model.PutObjectResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

/**
 * 📖：beishan
 * 🗓️：2024/4/5 17:21
 * =====================
 */
@Service
public class OssServiceImpl implements IOssService {
    @Autowired
    private OssTemplate ossTemplate;
    @Override
    public String upload(MultipartFile file, String dir) {

        return ossTemplate.upload(file, dir);
    }
}
